const {
	$USetCache,
	$UGetCache,
	$URemoveCacheAll,
} = require('@utils/storage')
const {
	userMenuList,
} = require('@utils/config')

module.exports = {

	userSidder(state, getters) {
		let {
			userInfo,
		} = state
		return userMenuList(userInfo, 'sidder')
	},

	userMainMenu(state, getters) {
		let {
			userInfo,
		} = state
		return userMenuList(userInfo, 'main')
	},

	isLogin(state, getters) {
		let userInfo = $UGetCache('userInfo')
		state.userInfo = state.userInfo || userInfo
		return !!userInfo
	},
}